package com.chenxin.interact.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.chenxin.interact.domain.sapToWms.SapToWmsItem;
import com.chenxin.interact.mapper.SapToWmsItemMapper;
import com.chenxin.interact.service.ISapToWmsItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * SAP物料接口Service业务层处理
 *
 * @author gry
 * @date 2025-04-23
 */
@Service
public class SapToWmsItemServiceImpl implements ISapToWmsItemService {
    @Autowired
    private SapToWmsItemMapper sapToWmsItemMapper;

    @Override
    public SapToWmsItem selectSapToWmsItemById(Long id) {
        return sapToWmsItemMapper.selectById(id);
    }

    @Override
    public List<SapToWmsItem> selectSapToWmsItemList(SapToWmsItem sapToWmsItem) {
        return null;
    }

    @Override
    public SapToWmsItem selectSapToWmsItemByMatnr(String matnr) {
        QueryWrapper<SapToWmsItem> wrapper = new QueryWrapper<>();
        wrapper.eq("matnr", matnr);
        return sapToWmsItemMapper.selectOne(wrapper);
    }

    @Override
    public int updateSapToWmsItem(SapToWmsItem item) {
        return sapToWmsItemMapper.updateById(item);
    }

    @Override
    public int insertSapToWmsItem(SapToWmsItem item) {
        return sapToWmsItemMapper.insert(item);
    }
}
